package cl.ccs.migracionbcmc.util;


import java.util.HashMap;

public class UpgradeCode {
    
    private final static UpgradeCode INSTANCE = new UpgradeCode();
    private final static HashMap<String, String> UPGRADE;
    private final static HashMap<String, String> CONTRACT;
    private final static String INVALID = "";
    
    
    static {
        UPGRADE = new HashMap<String, String>();
        CONTRACT = new HashMap<String, String>();
        
        UPGRADE.put("ARM", "AUW");
        UPGRADE.put("ARW", "AUW");
        UPGRADE.put("AMM", "AUW");
        UPGRADE.put("AMW", "AUW");
        UPGRADE.put("PRM", "AUW");
        UPGRADE.put("PRW", "AUW");
        UPGRADE.put("CRM", "AUW");
        
        CONTRACT.put("ARM", "ADW");
        CONTRACT.put("ARW", "ADW");
        CONTRACT.put("AMM", "ADW");
        CONTRACT.put("AMW", "ADW");
        CONTRACT.put("PRM", "ADW");
        CONTRACT.put("PRW", "ADW");
        CONTRACT.put("CRM", "ADW");
        
    }

    public static UpgradeCode getInstance() {
        return INSTANCE;
    }
    
    private UpgradeCode() {
        super();
    }
    
    public String getUpgradeServiceCode(String teAvisaCode) {
        if (UPGRADE.containsKey(teAvisaCode)) {
            return UPGRADE.get(teAvisaCode);
        }
        return INVALID;
    }
    
    public String getContractUpgradeServiceCode(String teAvisaCode) {
        if (CONTRACT.containsKey(teAvisaCode)) {
            return CONTRACT.get(teAvisaCode);
        }
        return INVALID;
    }
}
